package presentacion;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JButton;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import javax.swing.JLabel;
import javax.swing.ImageIcon;

import dominio.ListenerCerrarVentana;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.Cursor;

public class AcercaDe {

	JFrame VentanaAcercaDe;
	private JButton btnOk;
	private JLabel label;
	private JLabel lblRunV;
	private JLabel lblVersin;
	private JLabel lblRealizadoPor;
	private JLabel lblRosanaRodrguezbobadaAranda;
	private JLabel lblFranciscoRuizRomero;
	private JLabel lblInteraccinPersonaordenador;
	private JFrame ventanInvocadora;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AcercaDe window = new AcercaDe(null);
					window.VentanaAcercaDe.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public AcercaDe(JFrame ventana) {
		ventanInvocadora=ventana;
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		VentanaAcercaDe = new JFrame();
		VentanaAcercaDe.setResizable(false);
		VentanaAcercaDe.addWindowListener(new ListenerCerrarVentana(VentanaAcercaDe));
		VentanaAcercaDe.setIconImage(Toolkit.getDefaultToolkit().getImage(AcercaDe.class.getResource("/recursos/LOGO-pqeq.png"))); //$NON-NLS-1$
		VentanaAcercaDe.getContentPane().setBackground(Color.WHITE);
		VentanaAcercaDe.setTitle(Messages.getString("AcercaDe.1")); //$NON-NLS-1$
		VentanaAcercaDe.setBounds(100, 100, 580, 302);
		VentanaAcercaDe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		VentanaAcercaDe.getContentPane().setLayout(null);
		VentanaAcercaDe.setLocationRelativeTo(null);
		{
			btnOk = new JButton("OK"); //$NON-NLS-1$
			btnOk.setMnemonic('B');
			btnOk.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
			btnOk.addActionListener(new BtnOkActionListener());
			btnOk.setBounds(451, 212, 89, 23);
			VentanaAcercaDe.getContentPane().add(btnOk);
		}
		{
			label = new JLabel(""); //$NON-NLS-1$
			label.setIcon(new ImageIcon(AcercaDe.class.getResource("/recursos/AboutUsRun+.png"))); //$NON-NLS-1$
			label.setBounds(10, 28, 150, 166);
			VentanaAcercaDe.getContentPane().add(label);
		}
		{
			lblRunV = new JLabel("Gestor de Competiciones Run+ "); //$NON-NLS-1$
			lblRunV.setFont(new Font("Consolas", Font.BOLD, 12)); //$NON-NLS-1$
			lblRunV.setBounds(213, 39, 222, 14);
			VentanaAcercaDe.getContentPane().add(lblRunV);
		}
		{
			lblVersin = new JLabel(Messages.getString("AcercaDe.lblVersin.text")); //$NON-NLS-1$ //$NON-NLS-1$
			lblVersin.setFont(new Font("Consolas", Font.BOLD, 12)); //$NON-NLS-1$
			lblVersin.setBounds(213, 64, 222, 14);
			VentanaAcercaDe.getContentPane().add(lblVersin);
		}
		{
			lblRealizadoPor = new JLabel(Messages.getString("AcercaDe.9")); //$NON-NLS-1$
			lblRealizadoPor.setFont(new Font("Consolas", Font.BOLD, 12)); //$NON-NLS-1$
			lblRealizadoPor.setBounds(213, 89, 222, 14);
			VentanaAcercaDe.getContentPane().add(lblRealizadoPor);
		}
		{
			lblRosanaRodrguezbobadaAranda = new JLabel("Rosana Rodríguez-Bobada Aranda. 70592974-V"); //$NON-NLS-1$
			lblRosanaRodrguezbobadaAranda.setFont(new Font("Consolas", Font.BOLD, 12)); //$NON-NLS-1$
			lblRosanaRodrguezbobadaAranda.setBounds(238, 114, 306, 14);
			VentanaAcercaDe.getContentPane().add(lblRosanaRodrguezbobadaAranda);
		}
		{
			lblFranciscoRuizRomero = new JLabel("Francisco Ruiz Romero.          05715573-G"); //$NON-NLS-1$
			lblFranciscoRuizRomero.setFont(new Font("Consolas", Font.BOLD, 12)); //$NON-NLS-1$
			lblFranciscoRuizRomero.setBounds(238, 139, 306, 14);
			VentanaAcercaDe.getContentPane().add(lblFranciscoRuizRomero);
		}
		{
			lblInteraccinPersonaordenador = new JLabel("Interacción Persona-Ordenador 1.  2014/2015"); //$NON-NLS-1$
			lblInteraccinPersonaordenador.setFont(new Font("Consolas", Font.BOLD, 12)); //$NON-NLS-1$
			lblInteraccinPersonaordenador.setBounds(213, 164, 316, 14);
			VentanaAcercaDe.getContentPane().add(lblInteraccinPersonaordenador);
		}
	}
	private class BtnOkActionListener implements ActionListener {
		
		public void actionPerformed(ActionEvent e) {
			VentanaAcercaDe.setVisible(false);
			ventanInvocadora.setExtendedState(JFrame.NORMAL);
			ventanInvocadora.setVisible(true);
			ventanInvocadora.enable(true);

		}
	}
}
